var video_verify=new Array();
function video_status_change(radio)
{
	//	alert(radio.name+"\t"+radio.value);
	video_verify[radio.name] = radio.value;
	var del="";
	var cal="";
	var na ="";
	for (x in video_verify)
	{
		if (video_verify[x] == "del"){
			if (del == "")
				del = x;
			else
				del = del+","+x;
		}else if (video_verify[x] =="na"){
			if (na == "")
				na = x;
			else
				na = na+","+x;
		}else if (video_verify[x] == "cal"){
			if (cal == "")
				cal = x;
			else
				cal = cal+","+x;
		}
	}
	alert(del+"\n"+cal+"\n"+na);
}
function video_verify_submit(button,dow,cal,na,rowid)
{
	radio_dow  = document.getElementById(dow);
	radio_cal  = document.getElementById(cal);
	radio_na   = document.getElementById(na);
	radio_row  = document.getElementById(rowid);
	var action = ""; 
	var value  = "";

	if (radio_dow.checked){
		action = "dow";
		value  = radio_dow.value;
		alert(action);
	}
	if (radio_cal.checked){
		action = "cal";
		value  = radio_dow.value;
	}
	if (radio_na.checked){
		return true;
	}

	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();

	}
	else
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{

			//button.disabled = true;
			p = radio_row.parentNode;
			// 这里不能传递已经计算好的radio_row
			// 否则找不到
			// 智能重新算一遍
			var t=document.getElementById(rowid);
			p.removeChild(t);
			
		}
	}

	var r = xmlhttp.open("GET","../action/video_status_change.php?"+action+"="+value,true);
	xmlhttp.send();
}

function show_video()
{
	video_status = document.getElementById("video_status");
	product_list = document.getElementById("product_list");	
	vs	     = video_status.options[video_status.selectedIndex].value;
	pid	     = product_list.options[product_list.selectedIndex].value;
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();

	}
	else
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{                                


			document.getElementById("status_result").innerHTML= xmlhttp.responseText;
		}                                
	}                                  

	var r = xmlhttp.open("GET","../page/video_status.php?status="+vs+"&product_id="+pid,true);
	xmlhttp.send();        

}

